<?php
/**
* Returns array of assigned attributes of an image
* Helps in editing or displaying those attributes
*/
function smarty_modifier_assigned($image_id=0, $attribute='')
{
	$image_id = (int)$image_id;
	$images = new images();
	
	$ids = array();
	switch($attribute)
	{
	case 'categories':
		$ids = $images->assigned_categories($image_id);
		break;
	case 'colors':
		$ids = $images->assigned_colors($image_id);
		break;
	case 'sizes':
		$ids = $images->assigned_sizes($image_id);
		break;
	default:
		$ids = array();
	}
	
	return $ids;
}
?>